<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
    </style>
</head>

<body>
    <textarea name="" id="" rows="5" cols="20"></textarea>
    <button>提交</button>
    <div>123</div>
    <script>
        const tx = document.querySelector('textarea')
        const but = document.querySelector('button')
        const div = document.querySelector('div')
        but.addEventListener('click', function () {
            // replace(要替换的,替换为)
            let txs = tx.value.replace(/意识/g, '**')
            div.innerHTML = txs
        })
    </script>
</body>

</html>